package modelo.datos;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.JoinTable;


@Entity
@Table(name="niveldeinstruccion",schema="public")
@PrimaryKeyJoinColumn(name="codnivelinst")
public class nivel_instruccion {

	@Id
	@Column(name="codigo")
	private String codnivelinst;
	
	@Column(name="nombre")
    private	String nomnivelinst;
	
	 @ManyToMany(cascade = CascadeType.ALL)
	 @JoinTable(name="nivelxaviso", joinColumns={@JoinColumn(name="codigonivel")}, inverseJoinColumns={@JoinColumn(name="codigoavi")})
	 private Set<aviso> avisos=new HashSet();
	
	public nivel_instruccion(){
		super();
	}
public nivel_instruccion( String codnivelinst,String nomnivelinst){
     
	this.codnivelinst=codnivelinst;
	this.nomnivelinst=nomnivelinst;
	
	
	
}
public String getCodnivelinst() {
	return codnivelinst;
}
public void setCodnivelinst(String codnivelinst) {
	this.codnivelinst = codnivelinst;
}
public String getNomnivelinst() {
	return nomnivelinst;
}
public void setNomnivelinst(String nomnivelinst) {
	this.nomnivelinst = nomnivelinst;
}



}

